package com.itheima.bean;

public class Bus extends MotoVehicle {
    public static final String disCountMsg = "租车超过3天九折，超过7天八折，超过30天七折，超过150天五折。";
    private int seats;

    public Bus() {
    }

    public Bus(int seats) {
        this.seats = seats;
    }

    public Bus(String brand, String rent, String id, int seats) {
        super(brand, rent, id);
        this.seats = seats;
    }

    public static String getDisCountMsg() {
        return disCountMsg;
    }

    public int getSeats() {
        return seats;
    }

    public void setSeats(int seats) {
        this.seats = seats;
    }

    @Override
    public float calRent(int day) {
        // 总额 = 日租金*天数*优惠系数
        String rent = getRent();
        int totalMoney = Integer.parseInt(rent) * day;
        if (day < 3) {
            return totalMoney;
        } else if (day < 7) {
            return totalMoney * 0.9F;
        } else if (day < 30) {
            return totalMoney * 0.8F;
        } else if (day < 150) {
            return totalMoney * 0.7F;
        } else {
            return totalMoney * 0.5F;
        }
    }
}
